<template>
	<div id="now">
	  <ul>
	  	<li v-for="item in comPlayData" :key="item.id">
				<div class="img-wraper"><img :src="item.img" ></div>
				<div class="desc-wraper">
					<p class="name">{{item.name}}</p>
					<p><span class="score">{{item.people}}人想看</span></p>
					<p class="score actors">{{item.performer}}</p>
					<p class="score">未来30天上映</p>
				</div>
				<div class="button-wraper">
					<button>预售</button>
				</div>
			</li>
	  </ul>
	</div>
</template>

<script>
export default{
	name:'Coming',
	data(){
		return {
			comPlayData:[] 
		}
	},
	created(){
	 this.getCinemaData();
	},
	methods:{
		 getCinemaData(){
			 // var than=this;
			axios.get('/mock/comPlayData.json')
			 .then(response => {
			  console.log(response);
				if(response.status==200){
					 if(response.data && response.data.comPlayData){
					 this.comPlayData=response.data.comPlayData;
							}
					 }
					}
					)
					.catch(function (error) {
					  console.log(error);
					})
					}
					}
}



</script>

<style scoped>
	.img-wraper,.desc-wraper{
		float: left;
	}
	.button-wraper{
		float: right;
		line-height: 80px;
	}
	img{
		width: 70px;
	}
	.img-wraper{
		width: 23%;
		margin-bottom: 10px;
	}
	.desc-wraper{
		width: 60%;
	}
	ul{
		width: 100%;
	}
	li{
		width: 95%;
		margin: 15px;
		overflow: hidden;
		border-bottom: 1px solid #CCCCCC;
	}
	
	.name{
		font-size: 18px;
		margin-left: 5px;
		font-weight: bold;
	}
	.score{
		color: #666;;
		font-weight: bold;
		margin-left: 5px;
	}
	.actors{
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	p{
		line-height: 25px;
	}
	button{
		width: 50px;
		height: 30px;
		color: white;
		background-color: #439ceb;
		border-radius: 5px;
		border: none;
		font-weight: bold;
	}
</style>